package org.lee.visitor.app.user;

import lombok.Getter;
import org.lee.visitor.app.visitor.Visitor;

/**
 * User
 * 用户
 *
 * @author dralee
 * @date 2021-11-24 14:14:21
 **/
@Getter
public abstract class User {

    /**
     * 名称
     */
    private String name;
    /**
     * 身份
     */
    private Identity identity;
    /**
     * 年级
     */
    private Grade grade;
    /**
     * 班号
     */
    private int classNo;

    public User(String name, Identity identity, Grade grade, int classNo) {
        this.name = name;
        this.identity = identity;
        this.grade = grade;
        this.classNo = classNo;
    }

    public String gradeClass() {
        return grade.getName().concat(String.valueOf(classNo)).concat("班");
    }

    /**
     * 访问方法
     *
     * @param visitor
     */
    public abstract void accept(Visitor visitor);
}
